(0) Obligation:

Clauses:

h(X) :- ','(f(X), g(X)).
f(c(0, X1)).
f(c(X, Y)) :- ','(no(zero(X)), ','(p(X, P), f(c(P, s(Y))))).
g(c(X2, 0)).
g(c(X, Y)) :- ','(no(zero(Y)), ','(p(Y, P), g(c(s(X), P)))).
p(0, 0).
p(s(X), X).
zero(0).
no(X) :- ','(X, ','(!, failure(a))).
no(X3).
failure(b).

Query: h(g)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

gA(X1, s(X2)) :- gA(s(X1), X2).
fB(s(X1), X2) :- fB(X1, s(X2)).
hC(c(0, s(s(s(s(s(s(s(s(X1)))))))))) :- gA(s(s(s(s(s(s(s(0))))))), X1).
hC(c(s(X1), X2)) :- fB(X1, X2).
hC(c(s(X1), X2)) :- ','(fcB(X1, X2), gA(X1, X2)).

Clauses:

gcA(X1, 0).
gcA(X1, s(X2)) :- gcA(s(X1), X2).
fcB(0, X1).
fcB(s(X1), X2) :- fcB(X1, s(X2)).

Afs:

hC(x1)  =  hC(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
hC_in: (b)
gA_in: (b,b)
fB_in: (b,b)
fcB_in: (b,b)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

HC_IN_G(c(0, s(s(s(s(s(s(s(s(X1)))))))))) → U3_G(X1, gA_in_gg(s(s(s(s(s(s(s(0))))))), X1))
HC_IN_G(c(0, s(s(s(s(s(s(s(s(X1)))))))))) → GA_IN_GG(s(s(s(s(s(s(s(0))))))), X1)
GA_IN_GG(X1, s(X2)) → U1_GG(X1, X2, gA_in_gg(s(X1), X2))
GA_IN_GG(X1, s(X2)) → GA_IN_GG(s(X1), X2)
HC_IN_G(c(s(X1), X2)) → U4_G(X1, X2, fB_in_gg(X1, X2))
HC_IN_G(c(s(X1), X2)) → FB_IN_GG(X1, X2)
FB_IN_GG(s(X1), X2) → U2_GG(X1, X2, fB_in_gg(X1, s(X2)))
FB_IN_GG(s(X1), X2) → FB_IN_GG(X1, s(X2))
HC_IN_G(c(s(X1), X2)) → U5_G(X1, X2, fcB_in_gg(X1, X2))
U5_G(X1, X2, fcB_out_gg(X1, X2)) → U6_G(X1, X2, gA_in_gg(X1, X2))
U5_G(X1, X2, fcB_out_gg(X1, X2)) → GA_IN_GG(X1, X2)

The TRS R consists of the following rules:

fcB_in_gg(0, X1) → fcB_out_gg(0, X1)
fcB_in_gg(s(X1), X2) → U9_gg(X1, X2, fcB_in_gg(X1, s(X2)))
U9_gg(X1, X2, fcB_out_gg(X1, s(X2))) → fcB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HC_IN_G(c(0, s(s(s(s(s(s(s(s(X1)))))))))) → U3_G(X1, gA_in_gg(s(s(s(s(s(s(s(0))))))), X1))
HC_IN_G(c(0, s(s(s(s(s(s(s(s(X1)))))))))) → GA_IN_GG(s(s(s(s(s(s(s(0))))))), X1)
GA_IN_GG(X1, s(X2)) → U1_GG(X1, X2, gA_in_gg(s(X1), X2))
GA_IN_GG(X1, s(X2)) → GA_IN_GG(s(X1), X2)
HC_IN_G(c(s(X1), X2)) → U4_G(X1, X2, fB_in_gg(X1, X2))
HC_IN_G(c(s(X1), X2)) → FB_IN_GG(X1, X2)
FB_IN_GG(s(X1), X2) → U2_GG(X1, X2, fB_in_gg(X1, s(X2)))
FB_IN_GG(s(X1), X2) → FB_IN_GG(X1, s(X2))
HC_IN_G(c(s(X1), X2)) → U5_G(X1, X2, fcB_in_gg(X1, X2))
U5_G(X1, X2, fcB_out_gg(X1, X2)) → U6_G(X1, X2, gA_in_gg(X1, X2))
U5_G(X1, X2, fcB_out_gg(X1, X2)) → GA_IN_GG(X1, X2)

The TRS R consists of the following rules:

fcB_in_gg(0, X1) → fcB_out_gg(0, X1)
fcB_in_gg(s(X1), X2) → U9_gg(X1, X2, fcB_in_gg(X1, s(X2)))
U9_gg(X1, X2, fcB_out_gg(X1, s(X2))) → fcB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 9 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FB_IN_GG(s(X1), X2) → FB_IN_GG(X1, s(X2))

The TRS R consists of the following rules:

fcB_in_gg(0, X1) → fcB_out_gg(0, X1)
fcB_in_gg(s(X1), X2) → U9_gg(X1, X2, fcB_in_gg(X1, s(X2)))
U9_gg(X1, X2, fcB_out_gg(X1, s(X2))) → fcB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FB_IN_GG(s(X1), X2) → FB_IN_GG(X1, s(X2))

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FB_IN_GG(s(X1), X2) → FB_IN_GG(X1, s(X2))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • FB_IN_GG(s(X1), X2) → FB_IN_GG(X1, s(X2))
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GA_IN_GG(X1, s(X2)) → GA_IN_GG(s(X1), X2)

The TRS R consists of the following rules:

fcB_in_gg(0, X1) → fcB_out_gg(0, X1)
fcB_in_gg(s(X1), X2) → U9_gg(X1, X2, fcB_in_gg(X1, s(X2)))
U9_gg(X1, X2, fcB_out_gg(X1, s(X2))) → fcB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GA_IN_GG(X1, s(X2)) → GA_IN_GG(s(X1), X2)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GA_IN_GG(X1, s(X2)) → GA_IN_GG(s(X1), X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GA_IN_GG(X1, s(X2)) → GA_IN_GG(s(X1), X2)
    The graph contains the following edges 2 > 2

(20) YES